Skip to content

Conversation

@Exanite
Copy link
Owner

@Exanite Exanite commented Jan 14, 2026

Summary of the PR

A short summary of this PR and what it adds/removes/fixes.

Related issues, Discord discussions, or proposals

Links go here.

Further Comments

Copy link
Owner Author

@Exanite Exanite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review complete

bool KnownBitmask,
string? ExclusiveVendor,
string? Namespace
);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was becoming unreadable, especially since I split KnownBitmask into two separate values (see doc comments for IsDefinitelyBitmask and IsMaybeBitmask on added side of the diff).

/// <summary>
/// The base type of the group.
/// </summary>
public string? BaseType { get; init; }
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed for clarity.


// OpenGL-style enums have an uint base type
var baseType = anyGLStyleGroups ? "uint" : null;
string? namespaceGroupName = null;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to handle the 3 cases (namespace enum, enum group, and additional GL-style groups) separately instead of combining the namespace enum and enum group cases together. This is a bit easy to read/debug and lets us handle each case more specifically.

}
}

// Create an ungrouped group as well i.e. GLEnum, WGLEnum, etc
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Ungrouped group" sounds weird. I've been just calling these the namespace enums.

var topLevelIntentionalExclusion =
groupName is not null && IsIntentionalExclusion(groupName);
groupName != null
&& namespaceGroupName == null
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a side effect of the "handle namespace enums separately" change above.
This is because groupName used to always be GLEnum and similar before. Now groupName actually contains the enum group name (eg: "SpecialNumbers"), so I added this to keep the behavior the same.

Reverting this change causes the "SpecialNumbers" members to be removed from the generated bindings.

I'd like to handle this a bit better, but I'd like to work on OpenCL and the other Khronos APIs a bit more before that.

NativeName = nativeName ?? groupName,
BaseType = baseType,

IsDefinitelyBitmask = isBitmask,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If isBitmask is true, this means the XML explicitly states that the enum group is a bitmask. This is different from checking whether an enum member is part of a bitmask group, which is what is handled below in the "Parse enum members" loop.

Note that we can't combine these into one boolean property. There are 3 states (not bitmask, maybe bitmask, and definitely bitmask). I opted for two booleans. An enum also works, but is also unwieldy.

? memberGroup with
{
KnownBitmask = isBitmask && groupInfo.KnownBitmask,
IsMaybeBitmask = isBitmask && memberGroup.IsMaybeBitmask,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the original bitmask detection logic for OpenGL-style groups.

@Exanite Exanite marked this pull request as ready for review January 14, 2026 11:37
@Exanite Exanite marked this pull request as draft January 14, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants